#ifndef _BEEP_DRV_H__
#define _BEEP_DRV_H__
#include "config.h"
#include "STC32G_PWM.h"
#include "STC32G_NVIC.h"
#include "modbus_user.h"

/** 预分频器设置
PWMA_Prescaler(n)	
PWMB_Prescaler(n)	
*/

#define DEF_PWM_PERIOD          (8000 - 1)     
#define PWM_DUTY_PERCENT(x)     (DEF_PWM_PERIOD + 1) / 100 * (x)
// #define PRE_DIVISION            (5 - 1)          //预分频

#define BEEP_ON()               PWMA_Duty2(PWM_DUTY_PERCENT(80))
#define BEEP_OFF()              PWMA_Duty2(PWM_DUTY_PERCENT(0))

void Beep_Init(void);

#endif /* _BEEP_DRV_H__ */
